package com.study.talk.ui.app.register

import android.os.Bundle
import androidx.activity.viewModels
import androidx.appcompat.app.AppCompatActivity
import androidx.lifecycle.ViewModelProvider
import com.study.talk.databinding.ActivityRegisterBinding
import com.study.talk.utils.alert.AlertUtil
import dagger.hilt.android.AndroidEntryPoint

@AndroidEntryPoint
class RegisterActivity : AppCompatActivity() {

    private val binding by lazy { ActivityRegisterBinding.inflate(layoutInflater) }

    private val vm: RegisterViewModel by viewModels(factoryProducer = {
        ViewModelProvider.AndroidViewModelFactory(application = application)
    })

    override fun onCreate(savedInstanceState: Bundle?) {
        super.onCreate(savedInstanceState)
        setContentView(binding.root)
        setSupportActionBar(binding.registerToolbar)
        binding.registerToolbar.setNavigationOnClickListener { _ ->
            AlertUtil.showAllAction(
                this, "操作提醒", "确定退出注册吗"
            ) { if (it) finish() }
        }
    }
}